
NS_ASSUME_NONNULL_BEGIN

@interface JMNetworkUtils : NSObject {
}

+ (JMNetworkUtils *)sharedInstance;

+ (void)ShowToastByContent:(NSString *)content afterDelay:(NSInteger)delay actionEnabled:(bool)isEnabled withBlock:(void (^_Nullable)(void))completionBlock;
+ (void)showHudWithText:(NSString *)textString;
+ (void)showAutomicHiddenHudText:(NSString *)textString;
+ (void)showHudWithText:(NSString *)textString duration:(NSTimeInterval)duration;
+ (void)dismiss;

+ (void)showAlertView:(NSString *)title withOkBlock:(void (^_Nullable)(void))okBlock withCancelBlock:(void (^_Nullable)(void))cancelBlock;

//
- (void)connectWithUrl:(NSString *)url
            parameters:(NSDictionary *_Nullable)dic
               showHud:(bool)isShowed
               success:(void (^_Nullable)(id responseObject, bool isSuccess))success
               failure:(void (^_Nullable)(NSError *error))failure;

//
- (void)connectWithUrl:(NSString *)url
            parameters:(NSDictionary *_Nullable)dic
               showHud:(bool)isShowed
            withMethod:(NSString *)Method
               success:(void (^_Nullable)(id responseObject, bool isSuccess))success
               failure:(void (^_Nullable)(NSError *error))failure;

//
- (void)connectWithUrl:(NSString *)url
            parameters:(NSDictionary *_Nullable)dic
               showHud:(bool)isShowed
            showErrHud:(bool)isShowedErr
            withMethod:(NSString *)Method
               success:(void (^_Nullable)(id responseObject, bool isSuccess))success
               failure:(void (^_Nullable)(NSError *error))failure;

//
- (void)connectWithUrl:(NSString *)url
            parameters:(NSDictionary *_Nullable)dic
               showHud:(bool)isShowed
            showErrHud:(bool)isShowedErr
               success:(void (^_Nullable)(id responseObject, bool isSuccess))success
               failure:(void (^_Nullable)(NSError *error))failure;

@property(nonatomic, copy) void (^_Nullable completionCallBack)(void);

@end

NS_ASSUME_NONNULL_END
